\subsection{Definitions}
Let \(E \subseteq \mathbb C\) be a non-empty set, and \(f \colon E \to \mathbb C\) be any function, and let \(a \in E\).
Certainly, this includes the case in which \(f\) is a real-valued function and \(E \subseteq \mathbb R\).
\begin{definition}
	\(f\) is continuous at \(a\) if for every sequence \(z_n \in E\) that converges to \(a\), we have \(f(z_n) \to f(a)\).
\end{definition}
We can use an alternative definition:
\begin{definition}[\(\varepsilon\)-\(\delta\) definition]
	\(f\) is continuous at \(a\) if given \(\varepsilon > 0\), \(\exists \delta > 0\) such that for every \(z \in E\), if \(\abs{z - a} < \delta\), then \(\abs{f(z) - f(a)} < \varepsilon\).
\end{definition}
We will immediately prove that both definitions are equivalent.
First, let us prove that the \(\varepsilon\)-\(\delta\) definition implies the first definition.
\begin{proof}
	We know that given \(\varepsilon > 0, \exists \delta > 0\) such that for all \(z \in E\), \(\abs{z - a} < \delta\) implies \(\abs{f(z) - f(a)} < \varepsilon\).
	Let \(z_n \to a\), then by the definition of the limit of the sequence then there exists \(n_0\) such that for all \(n \geq n_0\) we have \(\abs{z_n - a} < \delta\).
	But this implies that \(\abs{f(z_n) - f(a)} < \varepsilon\), i.e.\ \(f(z_n) \to f(a)\).
\end{proof}
We now prove the converse, that the first definition implies the second.
\begin{proof}
	We know that for every sequence \(z_n \in E\) that converges to \(a\), \(f(z_n) \to f(a)\).
	Suppose \(f\) is not continuous at \(a\), according to the \(\varepsilon\)-\(\delta\) definition.
	Then there exists some \(\varepsilon\) such that for all \(\delta > 0\), there exists \(z \in E\) such that \(\abs{z - a} < \delta\) but \(\abs{f(z) - f(a)} \geq \varepsilon\).
	So, let us construct a sequence of \(\delta\) values to substitute into this definition.
	Let \(\delta = 1/n\).
	Then the \(z_n\) given by this \(\delta\) is such that \(\abs{z_n - a} < 1/n\) and \(\abs{f(z_n) - f(a)} \geq \varepsilon\).
	Clearly, \(z_n \to a\), but \(f(z_n)\) does not tend to \(f(a)\) because the difference between the two is always greater than \(\varepsilon\).
	This is a contradiction, since we assumed that \(f\) is continuous by the first definition.
	So \(f\) is continuous by the \(\varepsilon\)-\(\delta\) definition.
\end{proof}

\subsection{Making continuous functions}
We can create new continuous functions from old ones by manipulating them in a number of ways.
\begin{proposition}
	Let \(g, f \colon E \to \mathbb C\) be continous functions at a point \(a \in E\).
	Then all of the functions
	\begin{itemize}
		\item \(f(z) + g(z)\)
		\item \(f(z)g(z)\)
		\item \(\lambda f(z)\) for some constant \(\lambda\)
	\end{itemize}
	are all continuous.
	In addition, if \(f(z) \neq 0\) everywhere in \(E\), then \(\frac{1}{f}\) is a continuous function at \(a\).
\end{proposition}
\begin{proof}
	Using the first definition, this is obvious using the fact that limits of sequences behave analogously.
\end{proof}
Trivially, the function \(f(z) = z\) is continuous.
From this, we can derive that every polynomial is continuous at every point in \(\mathbb C\).
Note that we say that \(f\) is continuous on the entire set \(E\) if it is continuous at every point \(a \in E\).

\subsection{Composition of continuous functions}
\begin{theorem}
	Let \(f \colon A \to \mathbb C\) and \(g \colon B \to \mathbb C\) where \(A, B \subseteq \mathbb C\) be two functions that can be composed, i.e.\ \(f(A) \subseteq B\).
	If \(f\) is continuous at \(a \in A\) and \(g\) is continuous at \(f(a) \in B\), then \(g \circ f \colon A \to \mathbb C\) is continuous at \(a\).
\end{theorem}
\begin{proof}
	Take any sequence \(z_n \to a\).
	By assumption, \(f(z_n) \to f(a)\).
	Now, let us define a new sequence \(w_n = f(z_n)\).
	Then \(w_n \in B\) and \(w_n \to f(a)\).
	Thus, \(g(f(z_n)) = g(w_n) \to g(f(a))\) by continuity, as required.
\end{proof}
Consider the function \(f\colon \mathbb R \to \mathbb R\) defined by
\[
	f(x) = \begin{cases}
		\sin\left( \frac{1}{x} \right) & x \neq 0 \\
		0                              & x = 0
	\end{cases}
\]
This is assuming the knowledge of \(\sin(x)\) being a continuous function \(\mathbb R\to \mathbb R\), which we will prove later.
So \(f(x)\) is certainly continuous at every point on \(\mathbb R\) excluding 0, since it is the composition of two continuous functions.
We can prove it is discontinuous at \(x=0\) by providing a sequence, for example
\[
	\frac{1}{x_n} = \left(2n + \frac{1}{2}\right)\pi
\]
Then \(x_n \to 0\), and \(f(x_n) = 1\).
But \(f(0) \neq 1\), so it is discontinuous.
Let us modify the example as follows.
\[
	f(x) = \begin{cases}
		x\sin\left( \frac{1}{x} \right) & x \neq 0 \\
		0                               & x = 0
	\end{cases}
\]
We can prove that this sequence is continuous at 0.
For an arbitrary sequence \(x_n \to 0\), then \(\abs{f(x_n)} \leq \abs{x_n}\) because \(\abs{\sin x} \leq 1\).
So \(f(x_n)\) is bounded by \(x_n\), which tends to zero, so \(f(x_n)\) tends to zero as required.
Now for a final example, let
\[
	f(x) = \begin{cases}
		1 & x \in \mathbb Q    \\
		0 & x \notin \mathbb Q
	\end{cases}
\]
This is discontinuous at every point.
If \(x \in \mathbb Q\), take a sequence \(x_n \to x\) with all \(x_n\) irrational, then \(f(x_n) = 0\) but \(f(x) = 1\).
Similarly, if \(x \notin \mathbb Q\), take a sequence \(x_n \to x\) with all \(x_n\) rational, then \(f(x_n) = 1\) but \(f(x) = 0\).
